
//
//  DHRadioCollectionViewCell.m
//  Moment
//
//  Created by dllo on 15/12/30.
//  Copyright © 2015年 片刻. All rights reserved.
//

#import "DHRadioCollectionViewCell.h"

@implementation DHRadioCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}
-(void)createView{
    _radioImageView = [UIImageView new];
    _radioImageView.frame = self.bounds;
    [self.contentView addSubview:_radioImageView];
    _radioLabel = [[UILabel alloc]init];
    [self.contentView addSubview:_radioLabel];
    [_radioLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(@0);
        make.left.equalTo(@0);
        make.right.equalTo(@0);
        make.height.equalTo(self.mas_height).multipliedBy(0.15);
    }];
    _radioLabel.backgroundColor = [UIColor colorWithWhite:0.414 alpha:1.000];
    _radioLabel.textColor = [UIColor whiteColor];

}
-(void)setMoreting:(Moreting *)moreting{
    if (_moreting != moreting) {
        _moreting = moreting;
    }
    NSURL *url = [NSURL URLWithString:_moreting.coverimg];
    [_radioImageView sd_setImageWithURL:url placeholderImage:PLACEHOLDER_IMAGE];
    _radioLabel.text = _moreting.title;
    _radioLabel.font = [UIFont systemFontOfSize:12];
}

@end
